package Homework08;

public class Test {
    public static void main(String[] args) {
//        CheckingAccount checkingAccount = new CheckingAccount(10000);
//        checkingAccount.deposit(10);//10009
//        checkingAccount.withdraw(10);//9998
//        System.out.println(checkingAccount.getBalance());//9998

        SavingAccount savingAccount = new SavingAccount(9999);
        savingAccount.deposit(1);//存1块 - 10000
        savingAccount.deposit(10);//存10块 - 10010
        savingAccount.deposit(10);//存10块 - 10020
        savingAccount.deposit(10);//存10块 - 10029 ，扣手续费

        System.out.println(savingAccount.getBalance());

        savingAccount.earnMonthlyInterest();//统计利息的同时重置免手续费的次数
        System.out.println(savingAccount.getBalance());//10129.29

        savingAccount.withdraw(100);//取钱，免手续费，10029.29
        System.out.println(savingAccount.getBalance());

    }
}
